<?php
/**
 * <i>select</i>元素
 *
 * @version $Id: ISelectElement.php 312 2008-04-23 16:29:38Z iwind $
 * @package util.sqlmap.element2
 */
class ISelectElement extends IAbstractElement {
	/**
	 * 取得SQL执行结果对应的Class名称
	 *
	 * @return string
	 */
	public function getResultClassName() {
		$resultClassName = $this->getNode()->getAttribute("resultClass");
		return $resultClassName;
	}
	
	/**
	 * 取得SQL执行结果对应的Map元素
	 *
	 * @return IParameterMapElement
	 */	
	public function getResultMap() {
		$resultMapName = $this->getNode()->getAttribute("resultMap");
		if ($resultMapName == "") {
			return null;
		}
		$namespace = $this->getNamespace();
		if ($namespace != null) {
			$resultMapName = $namespace . "." . $resultMapName;
		}
		$elementMap = $this->getElementMap();
		if (isset($elementMap[$resultMapName])) {
			return $elementMap[$resultMapName];
		}
		else {
			throw new ISqlMapException("can't find result map for <strong>{$resultMapName}</strong> in SQL " . $this->getSqlId());
		}
	}
}

?>